﻿#include<stdio.h>

#include<math.h>

int countdigit(int a, int b)

{
    a = abs(a);

    int n = 0;



    while (a / 10 != 0)

    {

        if (a % 10 == b)

        {

            n++;



        }   a = a / 10;

    }

    return n;

}



int main()

{

    int a, b, n;

    scanf_s("%d%d", &a, &b);

    n = countdigit(a, b);

    printf("count=%d", n);

    return 0;

}

